<template>
    <div>
        <script id="editor" type="text/plain"></script>
    </div>
</template>
<script>
    export default {
        name: 'ue',
        data () {
            return {
                editor: null
            }
        },
        props: {
            value: '',
            config: {}
        },
        mounted () {
            this.editor = window.UE.getEditor('editor', this.config);
            this.editor.addListener('ready',  () => {
                this.editor.setContent(this.value)
            })
        },
        methods: {
            getUEContent () {
                return this.editor.getContent()
            },
            addhtml(inserthtml,test){
                return this.editor.execCommand(inserthtml, test)
            },
            upUEContent(content){
                return this.editor.setContent(content)
            }

        },
        destroyed () {
            this.editor.destroy()
        }
    }
</script>